package com.zrar.ak.gkpt.util;

import java.io.Serializable;

/**
 * @ClassName: JsonResult<T>
 * @Description: 接口返回数据结果集封装类
 * @author: liyang
 * @date: 2020年2月25日
 */
public class JsonResult<T> implements Serializable {

    private int code;
    private String msg = "";
    private T data;

    public JsonResult(){}

    public JsonResult(JsonResultEnum jsonResultEnum, T data){
        this.code = jsonResultEnum.getCode();
        this.msg = jsonResultEnum.getValue();
        this.data = data;
    }

    public JsonResult(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

}
